package models

import (
	"gorm.io/gorm"
	"time"
)

type Driver struct {
	Id            uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	Drivername    string         `gorm:"column:drivername;type:varchar(255);not null;" json:"drivername"`
	Password      string         `gorm:"column:password;type:varchar(50);not null;" json:"password"`
	Mobile        string         `gorm:"column:mobile;type:varchar(11);not null;" json:"mobile"`
	DriverLicense string         `gorm:"column:driver_license;type:varchar(50);not null;" json:"driver_license"`
	Idcard        string         `gorm:"column:idcard;type:varchar(18);not null;" json:"idcard"`
	CreatedAt     time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt     time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (d *Driver) TableName() string {
	return "driver"
}
